package redis.client.nedis.util;

/**
 * 非线程安全的id自增类
 *
 * @author gaodong
 */
public class UnsafeIdUtil {
    public final static long Init = 0L;
    public final static long Max = 999999999L;

    /**
     * 获取下一个随机数
     *
     * @return
     */
    public static long getNextId(long seed) {
        long r = ++seed;
        if (r > Max) {
            r = Init;
        }
        return r;
    }
}
